class Student {
    String name;
    int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String toString() {
        return name + "@" + age;
    }

}

public class MListTest {
    static public void main(String [] args) {
        MList<Student> l = Node.etList();

        l.add(new Student("张三", 33));
        l.add(new Student("张二", 34));
        l.add(new Student("李三", 35));
        l.add(new Student("王三", 36));

        Student s;
        s = l.find(new Student("王二", 36), new NodeCmp<Student>() {
            public int cmp(Student s1, Student s2) {
                return s1.age - s2.age;
            }
        });
        System.out.println("查找结果: " + s);

        // l.show();
        while (l.next()) {
            System.out.println("姓名: " + l.value().name + ", 年龄: " + l.value().age);
        }

    }
}
